<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>then 方法 catch</title>
</head>
<body>
    <script>
        // console.dir(Promise);

        let p = new Promise((resolve, reject) => {
            //修改状态
            // resolve('成功啦!!');
            reject('失败啦!!');
        });

        //作用: 指定 promise 对象成功与失败的回调的  
        p.then(v => {
            //执行时, 可以接收到 PromiseResult 属性的值
            console.log(v);
        }, r => {
            console.warn(r);
        });


        // function Person(){
        //     this.name = name;
        //     this.age = age;
        // }

        // Person.prototype.run = function(){

        // }

        // let me = new Person()

    </script>
</body>
</html>